<?php

include ('wms-parser.php');

$nombre_archivo = "http://maps.co.mecklenburg.nc.us/geoserver/wms?request=GetCapabilities&service=WMS";
$gestor = fopen($nombre_archivo, "rb");
$contenido = stream_get_contents($gestor);
fclose($gestor);

$caps = & new CapabilitiesParser( );
$caps->parse($contenido);
$caps->free_parser( );



?>


<h1>WMS Services Description</h1>

<strong>WMS version:</strong> <?php echo $caps->version ?><br />
<!--<strong>Layers count:</strong> <?php echo sizeof($caps->layers) ?> <br />-->

<h2>Layers list</h2>
<ol>
<?php foreach ($caps->layers as $l) { 
	if ($l['Abstract'] == "Generated from postgis") {
?>
  <li><strong><?php echo $l['Title'] ?></strong><br />
  <strong><?php echo $l['Name'] ?></strong><br />
  <?php echo $l['Abstract'] ?><br />

  </li>
<?php } } ?>
</ol>

<?php
/*
Legend graphic
http://localhost:8080/geoserver/wms/GetLegendGraphic?VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=uasidata:impactareapoly

Limits: (<i><?php echo $l['LatLonBoundingBox']['minx'] . ',' .
                         $l['LatLonBoundingBox']['miny'] . ',' .
                         $l['LatLonBoundingBox']['maxx'] . ',' .
                         $l['LatLonBoundingBox']['maxy'];  ?>)</i>
						 
*/
?>